package com.fafu.test;


import org.junit.Test;
import org.mindrot.jbcrypt.BCrypt;

/**
 * BCrypt工具测试
 */
public class BCryptDemo {
	/**
	 *  加密测试
	 */
	@Test
	public void hash(){
		String gensalt = BCrypt.gensalt();
		System.out.println(gensalt);
		String asd= BCrypt.hashpw("971028", gensalt);
		System.out.println(asd);
	}

	/**
	 *  密码解析测试
	 */
	@Test
	public void check() {
		boolean ans = BCrypt.checkpw("971028","$2a$10$Pmz8wfeRqvIi3rVB7cuG1.433MC87U6KUZS/mBPm7MU.Ofb4YhqPm");
		System.out.println(ans);
	}
}
